﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Jw.Web.Areas.Weight.WebForm1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="../../../Content/js/gri/CreateControl.js" type="text/javascript"></script>
    <script language="javascript">
        CreateReport("Report");
        CreatePrintViewerEx("100%", "100%", "", "", false, "<param name=BorderStyle value=1>");
        //在网页初始加载时向报表提供数据
        function window_onload() {
            debugger;
                            var tm = "<%=tm%>";
            //                var end = "<%=endDate%>";
            //                var unit = "<%=unitId%>";

            var r = Report.MyInterface;
            ReportViewer.Report = r;

            //                Report.ParameterByName("PayTo").AsString = document.getElementById("txtPayTo").value;
            //                Report.ParameterByName("Date").AsString = document.getElementById("txtDate").value;
            //                Report.ParameterByName("Year").AsInteger = YearMonthDay[0];
            //                Report.ParameterByName("Month").AsInteger = YearMonthDay[1];
            //                Report.ParameterByName("Day").AsInteger = YearMonthDay[2];
            //                Report.ParameterByName("Amount").AsFloat = document.getElementById("txtAmount").value;

            CreatePrintViewer("WebForm1.grf", "");
            var SQL = "select * from  dbo.PT_BMCJBZSZ";
            //设置报表的ShowProgressUI属性，开启报表生成进度条显示
            ReportViewer.Report.ShowProgressUI = true;
            ReportViewer.DataURL = "xmlSQLData.aspx";
            ReportViewer.DataParam = SQL;
            //给参数赋值
            //                ReportViewer.Report.ParameterByName("beginDate").AsString = "2222";
            //                ReportViewer.Report.ParameterByName("endDate").AsString = end;
            //给静态框赋值
            //  ReportViewer.Report.ControlByName("parm1").AsStaticBox.Text = begin.substr(0, 7).toString() + "至" + end.substr(0, 7).toString();


            ReportViewer.Start();
        }
    </script>
</head>
<body onload="window_onload()">
</body>
</html>
